const { callWithAsyncErrorHandling } = require("vue")


// 字面量构建对象
let person = {name:'jack', age:22, greet: function(){
  console.log(` ${this.name} greetings!`)
}}
person.greet()

// class 模式构建对象
class Person {
  constructor(data){
    this.name = data.name
    this.age = data.age
  }
  greet() {
    console.log(` ${this.name} greetings!`)
  }
}

let jack = new Person({name:'jack', age:22})
jack.greet()
let john = new Person({name:'john', age:23})
john.greet()


